package com.wingsboat;

import java.util.Scanner;
import java.util.StringJoiner;

/**
 * @author wangzhong
 * @description: TODO
 * @date 2024/7/20 20:08
 */
public class Test9 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int i = scanner.nextInt();
        if (i <= 1 || i >= 100) {
            System.out.println("ERROR!");
        } else {
            CircleList list = new CircleList();
            for(int a = 1;a<=100;a++){
                list.add(a);
            }
            Node9 cur = list.header;
            int c = 1;
            while(list.size>=i){
                if(c==i){
                    c = 1;
                    list.remove(cur);
                }else{
                    c=c+1;
                }
                cur = cur.next;
            }
            list.print();
        }
    }
}

class CircleList{
    public int size;

    public Node9 header;

    public Node9 tail;

    public void add(int num){
        Node9 node = new Node9(num);
        if(size==0){
            header = node;
            tail = node;
        }else{
            tail.next = node;
            node.pre = tail;
            tail = node;
        }
        header.pre = tail;
        tail.next = header;
        size++;
    }

    public void remove(Node9 node){
        if(size==1){
            header = tail = null;
        }else{
            Node9 cpre = node.pre;
            Node9 cnext = node.next;
            cpre.next = cnext;
            cnext.pre = cpre;
            if(header == node) header = cnext;
            if(tail == node) tail = cpre;
        }
        size--;
    }
    public void print(){
        StringJoiner sj = new StringJoiner(",");

        Node9 cur = header;
        for (int i = 0; i < this.size; i++) {
            sj.add(cur.num + "");
            cur = cur.next;
        }

        System.out.println(sj.toString());
    }
}

class Node9{
    public int num;

    public Node9 pre;

    public Node9 next;

    public Node9(int num){
        this.num = num;
        this.pre = null;
        this.next = null;
    }
}
